


#import "FAMTabBaritem.h"
#define KFMATabBarButtonImageRatio 0.6
@implementation FAMTabBaritem
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.imageView.contentMode = UIViewContentModeCenter;
//        self.titleLabel.textAlignment = NSTextAlignmentCenter;
//        self.titleLabel.font = kFont(12);
//        [self setTitleColor:[UIColor colorWithRed:205/255.0f green:89/255.0f blue:75/255.0f alpha:1.0] forState:UIControlStateSelected];
//        [self setTitleColor:[UIColor colorWithRed:117/255.0f green:117/255.0f blue:117/255.0f alpha:1.0] forState:UIControlStateNormal];
    }
    return self;
}
- (void)setHighlighted:(BOOL)highlighted{
    
}
//- (CGRect)imageRectForContentRect:(CGRect)contentRect{
//    CGFloat imageW = contentRect.size.width;
//    CGFloat imageH = contentRect.size.height;
//    return CGRectMake(0, 0, imageW, imageH);
//}
//- (CGRect)titleRectForContentRect:(CGRect)contentRect{
//    CGFloat titleY = contentRect.size.height * KFMATabBarButtonImageRatio;
//    CGFloat titleW = contentRect.size.width;
//    CGFloat titleH = contentRect.size.height - titleY;
//    return CGRectMake(0, titleY, titleW, titleH);
//}
- (void)setFMATabBarItem:(UITabBarItem *)FMATabBarItem{
    _FMATabBarItem = FMATabBarItem;
    [self setTitle:self.FMATabBarItem.title forState:UIControlStateNormal];
    [self setImage:self.FMATabBarItem.image forState:UIControlStateNormal];
    [self setImage:self.FMATabBarItem.selectedImage forState:UIControlStateSelected];
}
@end
